// src/main/java/com/xxxy/ljh/myapplication/model/ActivityItem.java
package com.xxxy.ljh.myapplication.model;

import java.io.Serializable;

public class ActivityItem implements Serializable {
    private int id;  // 对应数据库中的 activity_id
    private String title; // activity_name
    private int associationId; // association_id
    private int organizerId; // organizer_id
    private String description; // description
    private String activityType; // activity_type
    private String startTime; // start_time
    private String endTime; // end_time
    private String location; // location
    private int maxParticipants; // max_participants
    private String signupDeadline; // signup_deadline
    private String signupRequirement; // signup_requirement
    private int pointsRule; // points_rule
    private double cost; // cost
    private String costDescription; // cost_description
    private int status; // status
    private String coverImage; // cover_image
    private String createTime; // create_time
    private String updateTime; // update_time
    private String remark; // remark
    // 保留原有的 participants 字段用于兼容性
    private int participants;
    private String dateTime;

    public ActivityItem() {
        // 默认构造函数
    }

    // Getter 和 Setter 方法
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getAssociationId() {
        return associationId;
    }

    public void setAssociationId(int associationId) {
        this.associationId = associationId;
    }

    public int getOrganizerId() {
        return organizerId;
    }

    public void setOrganizerId(int organizerId) {
        this.organizerId = organizerId;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getActivityType() {
        return activityType;
    }

    public void setActivityType(String activityType) {
        this.activityType = activityType;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public int getMaxParticipants() {
        return maxParticipants;
    }

    public void setMaxParticipants(int maxParticipants) {
        this.maxParticipants = maxParticipants;
    }

    public String getSignupDeadline() {
        return signupDeadline;
    }

    public void setSignupDeadline(String signupDeadline) {
        this.signupDeadline = signupDeadline;
    }

    public String getSignupRequirement() {
        return signupRequirement;
    }

    public void setSignupRequirement(String signupRequirement) {
        this.signupRequirement = signupRequirement;
    }

    public int getPointsRule() {
        return pointsRule;
    }

    public void setPointsRule(int pointsRule) {
        this.pointsRule = pointsRule;
    }

    public double getCost() {
        return cost;
    }

    public void setCost(double cost) {
        this.cost = cost;
    }

    public String getCostDescription() {
        return costDescription;
    }

    public void setCostDescription(String costDescription) {
        this.costDescription = costDescription;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getCoverImage() {
        return coverImage;
    }

    public void setCoverImage(String coverImage) {
        this.coverImage = coverImage;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    // 保留原有的 getter 和 setter 用于兼容性
    public String getDateTime() {
        return startTime + " - " + endTime;
    }

    public void setDateTime(String dateTime) {
        this.dateTime = dateTime;
    }

    public int getParticipants() {
        return participants;
    }

    public void setParticipants(int participants) {
        this.participants = participants;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null || getClass() != obj.getClass()) return false;
        ActivityItem that = (ActivityItem) obj;
        return id == that.id;
    }

    @Override
    public int hashCode() {
        return id;
    }

    @Override
    public String toString() {
        return "ActivityItem{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", associationId=" + associationId +
                ", organizerId=" + organizerId +
                ", description='" + description + '\'' +
                ", activityType='" + activityType + '\'' +
                ", startTime='" + startTime + '\'' +
                ", endTime='" + endTime + '\'' +
                ", location='" + location + '\'' +
                ", maxParticipants=" + maxParticipants +
                ", signupDeadline='" + signupDeadline + '\'' +
                ", signupRequirement='" + signupRequirement + '\'' +
                ", pointsRule=" + pointsRule +
                ", cost=" + cost +
                ", costDescription='" + costDescription + '\'' +
                ", status=" + status +
                ", coverImage='" + coverImage + '\'' +
                ", createTime='" + createTime + '\'' +
                ", updateTime='" + updateTime + '\'' +
                ", remark='" + remark + '\'' +
                '}';
    }
}
